package com.program.cloudmanagesystem.login.controller;
import com.alibaba.nacos.api.annotation.NacosInjected;
//import jakarta.annotation.PostConstruct;
import com.program.cloudmanagesystem.login.domain.State;
import com.program.cloudmanagesystem.login.service.StateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;

//import javax.jws.WebParam;
//import javax.jws.soap.SOAPBinding;
import java.util.List;

@RestController
@RefreshScope
@RequestMapping("/")
public class StateController {
    @NacosInjected
    @Autowired
    private StateService stateService;
    @PostMapping ("/showStates")
    public List<State> searchHotel(){

        return stateService.showStates();
    }

    @PostMapping("/addWarn")
    public void signup(@RequestBody State state){

        stateService.addState(state);
    }
}
